<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Conf\ConfModel;

use Srv\Libs\ConfModel\ConfAbstract;

final class StorageConf extends ConfAbstract
{
    public const PREFIX                         = 'STORAGE.';           // 配置前缀[必定点结尾]
    private string $groupName                   = '';                   // 分组名
    protected string $category                  = '';                   // 分类[STS-腾讯云,SGS-谷歌云]
    protected string $appId                     = '';                   // 存储应用Id
    protected string $appName                   = '';                   // 应用名
    protected string $httpFile                  = '';                   // 文件访问地址
    protected string $httpImage                 = '';                   // 图片访问地址
    protected string $point                     = '';                   // 存储点
    protected string $secretId                  = '';                   // 存储Id
    protected string $secretKey                 = '';                   // 存储Key
    protected string $secretKeyFile             = '';                   // 存储秘钥KeyFile
    protected string $firebaseAdmFile           = '';                   // firebase AdmSDK File
    protected int $firebaseCustomTokenTtl       = 3600;                 // firebase Custom Token TTL [秒]

    /**
     * @param array $confData
     * @param string $groupName
     */
    public function __construct(array $confData, string $groupName)
    {
        $this->init($confData);
        $this->groupName = $groupName;
    }

    /**
     * @return string
     */
    public function getGroupName(): string
    {
        return $this->groupName;
    }

    /**
     * @return string
     */
    public function getCategory(): string
    {
        return $this->category;
    }

    /**
     * @return string
     */
    public function getAppId(): string
    {
        return $this->appId;
    }

    /**
     * @return string
     */
    public function getAppName(): string
    {
        return $this->appName;
    }

    /**
     * @return string
     */
    public function getHttpFile(): string
    {
        return $this->httpFile;
    }

    /**
     * @return string
     */
    public function getHttpImage(): string
    {
        return $this->httpImage;
    }

    /**
     * @return string
     */
    public function getPoint(): string
    {
        return $this->point;
    }

    /**
     * @return string
     */
    public function getSecretId(): string
    {
        return $this->secretId;
    }

    /**
     * @return string
     */
    public function getSecretKey(): string
    {
        return $this->secretKey;
    }

    /**
     * @return string
     */
    public function getSecretKeyFile(): string
    {
        return $this->secretKeyFile;
    }

    /**
     * @return string
     */
    public function getFirebaseAdmFile(): string
    {
        return $this->firebaseAdmFile;
    }

    /**
     * @return int
     */
    public function getFirebaseCustomTokenTtl(): int
    {
        return $this->firebaseCustomTokenTtl;
    }
}